/**
 * 
 */
package ac.svn.accesscontrol.store;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Enigmanic
 *
 */
public class SVNComponentRegistry 
{
	private Map<Integer,Object> componentMap;
	private static SVNComponentRegistry  componentRegistry;

	public SVNComponentRegistry()
	{
		componentMap = new HashMap<Integer, Object>();
	}
	
	private static SVNComponentRegistry getComponentRegistry() {
		if(null == componentRegistry)
		{
			componentRegistry = new SVNComponentRegistry();
		}
		return componentRegistry;
	}

	
	public static void addComponent(Integer componentId, Object component)
	{
		getComponentRegistry().componentMap.put(componentId, component);
	}
	
	public static Object getComponent(Integer componentId)
	{
		return getComponentRegistry().componentMap.get(componentId);
	}
	
	public static void removeComponent(Integer componentId)
	{
		getComponentRegistry().componentMap.remove(componentId);
	}
	
	

}
